Skip to main content
Version: 5.6

Common Task Service

This service contains methods in order to work with common tasks of TimePunch. Common Tasks can be used in any project.

GetActiveCommonTasks

This method loads all common tasks that are active. Active tasks are such which have no delete flag set.

List<TaskDto> GetActiveCommonTasks(  
out TpFault fault,
TpAuthentication authentication);
Needed PermissioncommonTasks@access
NameModifierDescription
faultOutContains the error if an exception occurs.
authenticationUser authentication
Return valueCollection of active common tasks

GetAllCommonTasks

This method load all common tasks, independently if they are marked as deleted or not.

List<TaskDto> GetAllCommonTasks(  
out TpFault fault,
TpAuthentication authentication);
Needed PermissioncommonTasks@access
NameModifierDescription
faultOutContains the error if an exception occurs.
authenticationUser authentication
Return valueCollection of common tasks

ImportTasks

This method imports the transferred activities. In contrast to the Save method, the activities are not mapped by ID, but by name.

List<TaskDto> ImportTasks(  
out TpFault fault,
TpAuthentication authentication,
List<TaskDto> tasks);
Needed PermissioncommonTasks@manage
NameModifierDescription
faultOutContains the error if an exception occurs.
authenticationUser authentication
tasksCollection of common tasks to import
Return ValueReturns a collection of all common tasks

LoadCommonTask

This method loads a single task. This can be useful if one has to reload a deleted task for a single time entry.

TaskDto LoadCommonTask(  
out TpFault fault,
TpAuthentication authentication,
Guid taskId);
Needed PermissioncommonTasks@access
NameModifierDescription
faultOutContains the error if an exception occurs.
authenticationUser authentication
Return valueThe loaded task

SaveCommonTasks

This method stores the common task list to the database. It’s important that the list contains all active tasks. Tasks that are not within the list, will be marked as deleted automatically.

void SaveCommonTasks(  
out TpFault fault,
TpAuthentication authentication,
IEnumerable<TaskDto> tasks);
Needed PermissioncommonTasks@manage
NameModifierDescription
faultOutContains the error if an exception occurs.
authenticationUser authentication
tasksCollection of active common tasks

SetTaskLifeCycle

This method sets the life cycle for the list of transferred tasks.

void SetTaskLifeCycle(  
out TpFault fault,
TpAuthentication authentication,
Guid[] taskIds,
TaskLifeCycle taskLifeCycle);
Needed Permissionprojects@manage
NameModifierDescription
faultOutContains the error if an exception occurs.
authenticationUser authentication
taskIdsCollection of task ids to set the life cylce
taskLifeCycleLife cylce to set for the task ids